<template>
  <view :data-theme="cueTheme">
    <basic-components />
    <custom-navbar title="快速选择项" right-text="完成" @right-click="save" />

    <view class="basic-search-box">
      <template v-if="dataGrid.data.length">
        <view v-for="item of dataGrid.data" :key="item.id" :right-options="options" class="table-box"
          @click="rowClick(item)">
          <view class="table-row">
            <view class="left">
              <image class="image" :src="setImgUrl(item)" />
              <view class="left-value">
                <view>
                  {{ item.taskName }}
                </view>
                <view class="type">
                  {{ item.taskType }}

                  <text class="priority">
                    <image v-for="i in item.priority" :key="i" class="image" src="~@/static/img/xing.png" />
                  </text>
                </view>
              </view>
            </view>

            <view class="right">
              <view>
                <view class="iconfont icon-xuanze2 checked"
                  :class="[dataGrid.selectId.includes(item.id) ? 'active-checked' : '']" />
                {{ item.planTime }} ( 分钟 )
              </view>
              <text>预计耗时</text>
            </view>
          </view>
        </view>
      </template>
      <view v-else-if="dataGrid.loading !== 1" class="main-no-data">
        请先配置快速选择项
      </view>
    </view>
  </view>
</template>

<script>
import { getFiles } from "@/utils/getFiles"
const files = require.context("./mixins", false, /\.js$/)
const mixins = getFiles(files)
import scroll from "@/common/mixins/scroll"

export default {
  mixins: [...mixins, scroll],
  onLoad(options) {
    this.taskDate = options.taskDate
  },
  onShow() {
    this.search()
  },
  data() {
    return {
    }
  }
}
</script>

